package com.i2silly.wxbot.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: wx-bot
 * @description：
 * @author: pzhongqiang@linewell.com
 * @date: 2020年11月30日 15:51:14
 */

@Configuration
public class WebConfig implements WebMvcConfigurer {

    /**
     * 配置静态访问资源
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //配置server虚拟路径，handler为页面中访问的目录，locations为files相对应的本地路径
        registry.addResourceHandler("/static/**")
                .addResourceLocations( "classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/");
    }
}